{{/*
This template is used only for `docsite check` (broken link checking), not for actually rendering
docs. It should emit roughly the same Markdown and links as the actual templates, to ensure that the
broken link checker checks the links that are produced by the actual templates.

https://docs.sourcegraph.com is rendered using https://github.com/sourcegraph/docs.sourcegraph.com.
*/}}
{{define "root"}}
{{with .Content}}{{template "index" .}}{{end}}
{{with .Content}}
	<nav class="breadcrumbs">
	{{range .Breadcrumbs}}
	<a href="{{.URL}}" class="{{if .IsActive}}active{{end}}">{{.Label}}</a> {{if not .IsActive}}/{{end}}
{{end}}
</nav>
	{{markdown .}}
{{end}}
{{end}}

{{define "index"}}
	{{with .Doc.Tree}}
		<h4 class="visible-sm">{{$.Doc.Title}}</h4>
		<ul>{{template "doc_nav" .}}</ul>
	{{end}}
{{end}}
{{define "doc_nav"}}
	{{range .}}
		<li>
			<a href="{{.URL}}">{{.Title}}</a>
			{{with .Children}}
				<ul>
					{{template "doc_nav" .}}
				</ul>
			{{end}}
	{{end}}
{{end}}
